# Python 2.6.4
# Project Euler, Problem 23
# Copyright 2010 Talha Zaman

sieve = [0 for i in range(0, 28124)]
for i in range(1,28124):
    for j in range(2*i, 28124, i):
        sieve[j] += i
abun = [x for x in range(len(sieve)) if sieve[x]>x]
absum = set()
for i in abun:
    for j in abun:
        if i+j<28124: absum.add(i+j)
print sum([x for x in range(28124) if x not in absum])
